#include<bits/stdc++.h>

using namespace std;
//输出四条边，注意这里只输出了一条
int main() {
    int h, w, x, y;
    while (cin >> h >> w) {
        if (h == 0 && w == 0)break;
        for (x = 1; x <= h; x++) {
            for (y = 1; y <= w; y++) {
                if (x == 1) {
                    cout << "#";
                } else {
                    cout << ".";
                }
            }
            cout << endl;
        }
        cout << endl;
    }
    return 0;
}
